﻿using System;
using System.Collections.Generic;

namespace ZD_DataModel
{
    /// <summary>
    /// 实体类对应数据表映射关系自定义特性类
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
    public class ZD_TabNameAttribute : Attribute
    {
        public ZD_TabNameAttribute(string TabName, string CNTabName, string PrimaryKey, bool IsAutoPrimaryKey)
        {
            this.TabName = TabName;
            this.PrimaryKey = PrimaryKey;
            this.IsAutoPrimaryKey = IsAutoPrimaryKey;
            this.CNTabName = CNTabName;
        }

        /// <summary>
        /// 表名
        /// </summary>
        public string TabName { get; set; }

        /// <summary>
        /// 中文表名（用于记录日志）
        /// </summary>
        public string CNTabName { get; set; }

        /// <summary>
        /// 主键名
        /// </summary>
        public string PrimaryKey { get; set; }

        /// <summary>
        /// 主键是否自增长
        /// </summary>
        public bool IsAutoPrimaryKey { get; set; }
    }
}
